Image scanning apparatus, image processing apparatus, and non-transitory computer-readable recording medium

ABSTRACT

A controller converts the original image data into converted image data representing a first converted image, analyzes the original image data and counts a number of first characters recognized in the original image represented by the original image data, and analyzes the converted image data and count a number of second characters recognized in the converted image represented by the first converted image data. The controller compares the number of first characters with the number of second characters and determine which one of the number of first characters and the number of second characters is greater than the other. The controller outputs the original image data when the controller determines that the number of first characters is greater than the number of second characters, and outputs the converted image data when the controller determines that the number of second characters is greater than the number of first characters.

CROSS REFERENCE TO RELATED APPLICATION

This application claims priority from Japanese Patent Application No.2011-262427, filed on Nov. 30, 2011, the entire disclosure of which isincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a technology that makes it easy for auser to recognize the content of an image represented by image data.

2. Description of Related Art

A known image scanning apparatus is configured to correct a ground colorof an image represented by image data by applying a correctioncoefficient to each pixel value of the image data.

SUMMARY OF THE INVENTION

When a ground color of an image is corrected by processing image data ofthe image, there may be a case where readability of the image isdegraded.

Therefore, a need has arisen for an image scanning apparatus and animage processing apparatus that are configured to output an image datawhile maintaining readability of an image represented by the outputimage data.

According to an embodiment of the invention, an image scanning apparatuscomprises a scanning unit and a controller. The scanning unit isconfigured to scan a document and generate original image datarepresenting an original image. The controller is configured to convertthe original image data into converted image data representing a firstconverted image, analyze the original image data and count a number offirst characters recognized in the original image represented by theoriginal image data, and analyze the converted image data and count anumber of second characters recognized in the converted imagerepresented by the first converted image data. The controller isconfigured to compare the number of first characters with the number ofsecond characters and determine which one of the number of firstcharacters and the number of second characters is greater than theother. The controller is configured to output the original image datawhen the controller determines that the number of first characters isgreater than the number of second characters, and output the convertedimage data when the controller determines that the number of secondcharacters is greater than the number of first characters.

According to another embodiment of the invention, an image processingapparatus comprises a controller. The controller is configured to obtainoriginal image data representing an original image, convert the originalimage data into converted image data representing a converted image,analyze the original image data and count a number of first charactersrecognized in the original image represented by the original image data,and analyze the converted image data and count a number of secondcharacters recognized in the converted image represented by the firstconverted image data. The controller is configured to compare the numberof first characters with the number of second characters and determinewhich one of the number of first characters and the number of secondcharacters is greater than the other. The controller is configured tooutput the original image data when the controller determines that thenumber of first characters is greater than the number of secondcharacters, and output the converted image data when the controllerdetermines that the number of second characters is greater than thenumber of first characters.

According to another embodiment of the invention, a non-transitorycomputer-readable recording medium, for use in an image processingapparatus, stores computer readable instructions. The computer readableinstructions, when executed by a processor, causes the image processingapparatus to perform obtaining original image data representing anoriginal image, converting the original image data into converted imagedata representing a converted image, analyzing the original image dataand counting a number of first characters recognized in the originalimage represented by the original image data, analyzing the convertedimage data and counting a number of second characters recognized in theconverted image represented by the first converted image data, comparingthe number of first characters with the number of second characters anddetermining which one of the number of first characters and the numberof second characters is greater than the other, outputting the originalimage data when the controller determines that the number of firstcharacters is greater than the number of second characters, andoutputting the converted image data when the controller determines thatthe number of second characters is greater than the number of firstcharacters.

Other objects, features, and advantages will be apparent to persons ofordinary skill in the art from the following detailed description of theinvention and the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the invention, the needs satisfiedthereby, and the features and technical advantages thereof, referencenow is made to the following descriptions taken in connection with theaccompanying drawings.

FIG. 1 is a schematic diagram showing the configuration of a scanning ofan image scanning apparatus, e.g., an image scanner, according to afirst embodiment of the invention.

FIG. 2 is a block diagram showing the electrical configuration of theimage scanner, according to the first embodiment of the invention.

FIG. 3 is a graph showing a change in density value caused by groundcolor correction, according to the first embodiment of the invention.

FIG. 4 is a schematic diagram showing examples of images whosecharacters after ground color correction become difficult to read for auser.

FIG. 5 is a flowchart showing the flow of a scanning and outputtingprocess, according to the first embodiment of the invention.

FIG. 6 is a flowchart showing the flow of a ground color correction,second character recognition, and second character number countingprocess, according to the first embodiment of the invention.

FIG. 7 is a flowchart showing the flow of a superiority determiningprocess, according to the first embodiment of the invention.

FIG. 8 is a flowchart showing the flow of a scanning and outputtingprocess, according to a second embodiment of the invention.

FIG. 9 is a flowchart showing the flow of a ground color correction,second character recognition, and second character number counting, andsuperiority determining process, according to the second embodiment ofthe invention.

FIG. 10 is a flowchart showing the flow of a scanning and outputtingprocess, according to a third embodiment of the invention.

FIG. 11 is a flowchart showing the flow of a ground color correction,second character recognition, and second character number counting, andsuperiority determining process, according to the third embodiment ofthe invention.

DETAILED DESCRIPTION OF EMBODIMENTS

Embodiments of the invention and their features and technical advantagesmay be understood by referring to FIGS. 1-11, like numerals being usedfor like corresponding parts in the various drawings.

A first embodiment of the invention will be described below withreference to FIGS. 1 to 7. FIG. 1 is a schematic diagram showing theconfiguration of a scanning unit 10 of an image scanning apparatus.e.g., an image scanner 1 (see FIG. 2), according to the firstembodiment. The following description will be given of the scanning unit10 of a CIS (Contact Image Sensor) type that scans a document using aone-to-one optical system by way of example. In addition to theconfiguration shown in FIG. 1, the scanning unit 10 comprises a devicecontroller 34, an AFE (Analog Front End) 35, a driving unit 36 and animage processing unit 37, which will be discussed later referring toFIG. 2.

An opening is formed in the top wall of a housing 11 of the imagescanner 1, and is closed by a platen glass 12. FIG. 1 merely shows apart of the housing 11. A document M to be scanned is to be mounted onthe platen glass 12. A document cover 13 has a document mat 14 thatholds the document M. The document cover 13 is coupled to the housing 11so as to be rotatable between a closed state to cover the platen glass12 and an open state to open the platen glass 12.

A scanning device 15 comprises a light source 16, an image sensor 17, arod lens array 18, and a carriage 19 on which those components are to bemounted. The light source 16 includes three-color (RGB) light emittingdiodes. The image sensor 17 has a plurality of light receiving elementsaligned linearly in a direction perpendicular to the surface of a sheetplane of FIG. 1 (main scanning direction). The rod lens array 18 leadslight reflected at the document M to the individual light receivingelements of the image sensor 17 to form a one-to-one image. The opticalsystem may be a reduction type optical system that forms a documentimage of a reduced size onto the image sensor 17.

A conveying mechanism 20 comprises a driving roller 21, a driven roller22 and a timing belt 23 put around the rollers 21 and 22. The conveyingmechanism 20 is driven by a driving unit 36 (to be described later) toconvey the scanning device 15 in a sub scanning direction (direction Ain FIG. 1) parallel to the surface of the platen glass 12.

The scanning device 15 is conveyed in the sub scanning direction by theconveying mechanism 20 to scan the document M line by line whilesequentially changing the colors of the light source 16.

FIG. 2 is a block diagram showing the electrical configuration of theimage scanner 1. The image scanner 1 comprises a controller 30, thedevice controller 34, the AFE 35, the driving unit 36, the imageprocessing unit 37, a displaying unit 38, an operating unit 39, and acommunication interface 40.

The controller 30 comprises a CPU 31, a ROM 32 and a RAM 33. The CPU 31executes various programs stored in the ROM 32 to control the individualsections of the image scanner 1. The control programs that are executedby the CPU 31, various kinds of data, etc. are stored in the ROM 32. TheRAM 33 is used as a main memory for the CPU 31 to execute variousprocesses. The controller 30 is an example of a controller.

The device controller 34 is a circuit to control the light source 16 andthe image sensor 17 of the scanning device 15 under control of thecontroller 30. The AFE 35 is a circuit to perform various processes,such as gain control on an analog signal output from the image sensor17, and A/D conversion to convert the gain-controlled analog signal to adigital signal. The driving unit 36, which is, for example, a steppingmotor, drives the aforementioned conveying mechanism 20.

The image processing unit 37 is a circuit to perform various kinds ofimage processing including gamma correction and shading correction onthe digital signal output from the AFE 35 to generate image data havingthree-color (ROB) density values for each pixel. The displaying unit 38comprises a display, e.g., a liquid crystal display, and a drivingcircuit to drive the display. The displaying unit 38 is an example of anotifying unit.

The operating unit 39 comprises various buttons. A user can make varioussettings and give a scanning instruction by operating the operating unit39. The user can also make a setting on whether or not to execute groundcolor correction to be described later by operating the operating unit39. The communication interface 40 provides communication with anexternal apparatus such as a personal computer over a communicationnetwork like LAN (Local Area Network), a USB (Universal Serial Bus), ora parallel circuit.

When a text document whose ground color is not white, such as anewspaper, is scanned to generate image data, a user may have difficultyin reading characters on an image represented by the generated imagedata in some cases due to the non-white ground color. To make it easierfor a user to read characters in an image, the image scanner 1 executesground color correction to make the ground color of an image representedby image data white or closer to white. Making the ground color white orcloser to white means an original ground color, which is taken as areference, is changed to white or a color closer to white than theoriginal ground color. In this embodiment, the density value of theground color after ground color correction is set greater than theoriginal density value. In the first embodiment, the ground color iscorrected to a predetermined ground color which is white.

For ease of understanding, according to the first embodiment, an imagerepresented by image data is assumed to be a monochromatic image. Amonochromatic image has same RGB density values for each pixel, so thatthe following description will be given of the density value of the Rcomponent. It is also assumed that the density values can take 256gradations or gray scales ranging from 0 (black) to 255 (white),according to the first embodiment.

According to the first embodiment, ground color correction is carriedout by applying a correction equation represented by the followingequations 1 and 2 to the density value (density value of the Rcomponent) of each of the pixels forming image data. It is assumed thatthe density value of the R component after ground color correction isdirectly used as the density value of the G component and the densityvalue of the B component after ground color correction.

Density Value After Ground Color Correction=Density Value Before GroundColor Correction×Correction Coefficient D  (Equation 1)

Correction Coefficient D=Maximum Density Value/Ground Color DensityValue  (Equation 2)

In the equation 2, the maximum density value is the greatest densityvalue each pixel can take, and is 255 according to this embodiment. Inthe equation 2, the ground color density value is the density value of apixel representing the ground color in an image represented by imagedata. In general, characters are written with a certain margin set fromthe top of a document. It is therefore likely that pixels within acertain range from the top of an image, i.e., pixels in the margin showthe ground color. In this respect, the image scanner 1 acquires densityvalues from pixels lying in a certain range from the top of an image,and sets the average value of the acquired density values as a groundcolor density value. The “certain range” can be determined as suited.

FIG. 3 is a graph showing a change in density value caused by theaforementioned ground color correction. The illustrated example shows acase where the ground color density value is 100. The ground colordensity value of 100 is converted to a density value of white of 255,according to the aforementioned correction equation. That is, the groundcolor is corrected to white.

It is to be noted however that because the correction equation isapplied to all the pixels according to the first embodiment, the pixelswhose colors are closer to white than the ground color, i.e., the pixelswhose density values are greater than 100, will have density values ofover 255 after ground color correction. Therefore, the pixels whosedensity values are equal to or greater than 100 before ground colorcorrection are all set to have a density value of 255 after ground colorcorrection.

As mentioned above, ground color correction is carried out to make iteasier for a user to read characters. However, when the color ofcharacters is closer to white than the ground color, ground colorcorrection when executed causes the characters to disappear, rathermaking it hard for a user to read the characters. This case will bedescribed below referring to FIG. 4.

FIG. 4 is a schematic diagram showing examples of images whosecharacters after ground color correction become difficult to read for auser. An image example 1 shows an image represented by image data whichis generated by scanning a document whose ground color is gray and whosecharacters are written in white. When ground color correction isexecuted on the image example 1, the ground color of gray becomes white,causing the white characters to disappear. Therefore, execution ofground color correction rather makes it difficult for a user to read thecharacters.

An image example 2 shows an image represented by image data which isgenerated by scanning a document whose ground color is separated intotwo colors so that a region where ground color density values areacquired and a region where characters are written have different groundcolors. In the illustrated example, the ground color of the region wherecharacters are written is white, and the ground color is closer to whitethan the color of the characters. Because the ground color density valueused in the correction equation is acquired from a region in a certainrange from the top of the image, the color of the characters is closerto white as compared to the ground color of this region. Therefore,execution of ground color correction sets both the color of thecharacters and the ground color to white, causing the characters todisappear.

As mentioned above, there is a case where execution of ground colorcorrection on an image rather makes it difficult for a user to readcharacters in the image. To cope with such a case, the image scanner 1executes a character recognition process on both an image represented byimage data before ground color correction and an image represented byimage data after ground color correction, and determines which isbetter, the result of recognition of the image before ground colorcorrection or the result of recognition of the image after ground colorcorrection. The image scanner 1 then outputs image data representingwhichever image whose recognition result has been determined to bebetter.

More specifically, the mage scanner 1 compares the number of charactersrecognized in an image represented by image data before ground colorcorrection (first character number) with the number of charactersrecognized in an image represented image data after ground colorcorrection (second character number). When the first character number isgreater than the second character number, the image scanner 1 determinesthat the recognition result of the image represented by the image databefore ground color correction is better, whereas when the secondcharacter number is greater than the first character number, the imagescanner 1 determines that the recognition result of the imagerepresented by the image data after ground color correction is better.This is because an image with a greater number of characters recognizedin the character recognition process can be said to be an image whosecharacters are easier to read for a user.

FIG. 5 is a flowchart showing the flow of a scanning and outputtingprocess, according to the first embodiment. In step 101 (hereinafter,step is abbreviated as S), the controller 30 scans a document andgenerates original image data, e.g., first image data.

In S102, the controller 30 stores the first image data in the RAM 33. InS103, the controller 30 determines whether the user has made a settingto execute ground color correction. When execution of ground colorcorrection is set (S103: YES), the controller 30 proceeds to S104. Whenexecution of ground color correction is not set (S103: NO), thecontroller 30 proceeds to S109.

In S104, the controller 30 executes the character recognition process onan image represented by the first image data. The controller 30 analyzesthe first image data, and recognizes and counts the number of characters(first character number). In FIG. 5, the image represented by the firstimage data is simply referred to as “first image”.

In S105, the controller 30 analyzes the first image data to acquire aground color density value indicating the ground color of the document.In S106, the controller 30 determines a correction coefficient D fromthe ground color density value acquired in S105.

In S107, the controller 30 executes ground color correction on secondimage data which is a duplication of the first image data, and executesa second character recognition and second character number countingprocess on an image represented by second image data converted throughground color correction. The details of the ground color correction,second character recognition, and second character number countingprocess will be given later.

In S108, the controller 30 executes a superiority determining process todetermine which one of the recognition result in S104 and therecognition result in S107 is better than the other. In the superioritydetermining process whose details will be given later, image datacorresponding to the recognition result which has been determined to bebetter is designated as an output target.

In S109, the controller 30 designates the first image data as an outputtarget. In S110, the controller 30 outputs the image data designated asthe output target in S108 or S109. The outputting of the image data maybe transmission thereof to an external apparatus, or writing thereofinto a removable memory which is detachably mounted in the image scanner1, or printing thereof by a printer which is configured integrally withthe image scanner 1.

FIG. 6 is a flowchart showing the flow of the ground color correction,second character recognition, and second character number countingprocess which is executed in S107. In S201, the controller 30 duplicatesthe first image data and stores it as second image data in the RAM 33.

In S202, the controller 30 executes ground color correction on an imagerepresented by the second image data using the correction coefficient Ddetermined in S106. In S203, the controller 30 executes the characterrecognition process on an image represented by the second image dataconverted through the ground color correction, and counts the number ofcharacters recognized in the image represented by the converted secondimage data (second character number).

FIG. 7 is a flowchart showing the flow of the superiority determiningprocess which is executed in S108. In S301, the controller 30 determineswhether the first character number and the second character number areboth less than or equal to a reference character number. When at leastone of the first character number and the second character number isgreater than the reference character number (S301: NO), the controller30 proceeds to S302. When the first character number and the secondcharacter number are both less than or equal to the reference characternumber (S301: YES), the controller 30 proceeds to S303. In S302, thecontroller 30 compares the first character number with the secondcharacter number. When the first character number is greater than orequal to the second character number, the controller 30 proceeds toS303. When the first character number is less than the second characternumber, the controller 30 proceeds to S305.

In S303, the controller 30 determines that the recognition resultprovided by the first character recognition process is better, anddesignates the first image data as image data to be output. In S304, thecontroller 30 displays a message that ground color correction has notbeen executed on the displaying unit 38. In S305, the controller 30determines that the recognition result provided by the second characterrecognition process is better, and designates the second image data asimage data to be output.

According to the above-described first embodiment, the image scanner 1outputs image data before ground color correction when it is determinedthat the recognition result provided by the first character recognitionprocess is better, and outputs image data after ground color correctionwhen it is determined that the recognition result provided by the secondcharacter recognition process is better. Accordingly, the image scanner1 can output whichever image data that makes it easier for a user torecognize the contents of the image, the image data before execution ofcorrection to correct the ground color of the image to white or theimage data after execution of the correction.

Further, the image scanner 1 determines that recognition result providedby the first character recognition process is better when the firstcharacter number is greater than the second character number, anddetermines that recognition result provided by the second characterrecognition process is better when the second character number isgreater than the first character number. When there are an originalimage and an image obtained by correcting the ground color of theoriginal image to white, it can be said that whichever image containingmore characters recognized in the character recognition process makes iteasier for a user to read the characters. Based on the first characternumber and the second character number, the image scanner 1 can outputwhichever image data that makes it easier for a user to read characters,the image data before execution of correction to correct the groundcolor to white or the image data after execution of the correction.

Furthermore, the image scanner 1 analyzes image data before ground colorcorrection to acquire the ground color density value indicating theground color of a document, and decides the correction coefficient D forconverting the acquired ground color density value to the density valueof white. This makes it possible to adequately decide, for each imagedata, a correction coefficient for correcting the ground color of animage to white.

In addition, the image scanner 1 outputs first mage data which is imagedata before correction, regardless of the determination in thesuperiority determining process, when the first character number and thesecond character number are both less than or equal to the referencecharacter number. If the ground color of an image which does not containa lot of characters is corrected to white, the image quality may bedegraded unnecessarily. However, the image scanner 1 can output imagedata before correction (first image data) when the first characternumber and the second character number are both less than or equal tothe reference character number, thus making it possible to prevent thequality of an image containing fewer characters from being degradedunnecessarily.

Moreover, when the image scanner 1 outputs image data before correction(first image data), the image scanner 1 notifies a user that groundcolor correction has not been executed, so that a user can find out thatground color correction has not been executed.

An image scanner according to a second embodiment of the invention willbe described below with reference to FIGS. 8 and 9. The description ofthe first embodiment has been given of the case where the ground colordensity value is acquired from image data to determine a correctioncoefficient D. According to the second embodiment, by way of contrast, aplurality of correction coefficients D different from one another areused at the time of making the ground color closer to white and are setbeforehand. The ground color correction, second character recognition,second character counting, and superiority determining process arerepeated while selecting a correction coefficient D from the correctioncoefficients D in order, whereby second image data is designated as anoutput target as much as possible.

It is assumed hereinbelow that N correction coefficients D1, D2, D3, . .. , DN (N≧1) are set beforehand, and the smaller the numeral affixed to“D”, the larger the value of the correction coefficient D, and thelarger the numeral affixed to “D”, the smaller the value of thecorrection coefficient D. The values of the individual correctioncoefficients D can be determined as suited.

Because a correction coefficient D affixed with a smaller numeral has alarger value, a correction coefficient D affixed with a smaller numeraldemonstrates a greater effect of making the ground color closer towhite, and a correction coefficient D affixed with a larger numeraldemonstrates a smaller effect of making the ground color closer towhite. According to the second embodiment, it is assumed that correctioncoefficients D are selected in the order of smaller-to-larger affixednumerals. That is, it is assumed that correction coefficients D areselected in the order of a greater-to-smaller effect of making theground color closer to white. In other words, correction coefficients Dare selected among a plurality of predetermined colors, in the order ofmaking the ground color to a darker predetermined color from a lighterpredetermined color.

FIG. 8 is a flowchart showing the flow of a scanning and outputtingprocess, according to the second embodiment. To avoid the redundantdescription, same reference numerals are given to the processing stepswhich are substantially the same as the corresponding processing stepsof the first embodiment. As mentioned above, correction coefficients Dstored in the memory unit beforehand are used in executing ground colorcorrection according to the second embodiment. Therefore, the steps ofacquiring a ground color density value from first image data anddetermining a correction coefficient D (S105 and S106 shown in FIG. 5)are not executed.

In S401, the controller 30 sets “1” to a counter n that counts thenumber of corrections. In S402, the controller 30 executes a groundcolor correction, second character recognition, second character numbercounting, and superiority determining process whose details will begiven later. In S402, the controller 30 designates second image data asan output target when the second character number is greater than thefirst character number, whereas the controller 30 does not designateneither first image data nor second image data as an output target whenthe first character number is greater than the second character number.

In S403, the controller 30 determines whether image data to be output isdesignated. When image data to be output is designated (S403: YES), thecontroller 30 proceeds to S110. When image data to be output is notdesignated (S403: NO), the controller 30 returns to S402 and repeats thesequence of processes.

FIG. 9 is a flowchart showing the flow of the ground color correction,second character recognition, second character number counting, andsuperiority determining process. To avoid the redundant description,same reference numerals are given to the processing steps which aresubstantially the same as the corresponding processing steps of thefirst embodiment.

In S501, the controller 30 determines whether the count of the counter nis equal to or less than N which is the number of the correctioncoefficients. When the count of the counter n is less than or equal to N(S501: YES), the controller 30 determines that there still is anunselected correction coefficient, and proceeds to S502. When the countof the counter n is greater than N (S501: NO), the controller 30 decidesthat all of the correction coefficients have been selected, and proceedsto S303. In S502, the controller 30 selects an nth correctioncoefficient Dn as the correction coefficient D.

In S503, the controller 30 compares the first character number countedin S104 with the second character number counted in S107. When the firstcharacter number is greater than or equal to the second characternumber, the controller 30 proceeds to S504. When the first characternumber is greater than the second character number, the controller 30proceeds to S305. In S504, the controller 30 deletes the second imagedata from the RAM 33. In S505, the controller 30 increments n by “1”.

The controller 30 repeats the foregoing ground color correction, secondcharacter recognition, second character number counting, superioritydetermining process until the controller 30 determines that therecognition result provided by the second character recognition processis better, i.e., determines in S503 that the second character number isgreater than the first character number, or until the ground colorcorrection is executed N times.

When the controller 30 determines that the recognition result providedby the second character recognition process is better, the second imagedata is designated as an output target in S305. When the ground colorcorrection is executed N times before the controller 30 determines thatthe recognition result provided by the second character recognition isbetter, the controller 30 determines that the recognition resultprovided by the first character recognition process is better, anddesignates the first image data as an output target in S303.

According to the above-described second embodiment, the image scannerdesignates the second image data as an output target as much as possibleby repeating the ground color correction, second character recognition,second character number counting, and superiority determining processwhile selecting the correction coefficients D in order, therebyincreasing the possibility of outputting the image data after correctionthat makes it easier for a user to read characters as compared withimage data before correction.

In addition, this image scanner selects a correction coefficient D froma plurality of previously set correction coefficients D different fromone another, so that the amount of processing for determining thecorrection coefficient D can be reduced as compared to the case whereimage data is analyzed to decide the correction coefficient D.

Further, the image scanner selects the correction coefficients D in theorder of a greater-to-smaller effect of making the ground color closerto white. If, for example, the correction coefficients D are selected inthe order of a smaller-to-greater effect of making the ground colorcloser to white, the ground color of an image gradually comes closer towhite. In this case, when characters become easier to read for a userthan those before correction, there may still be a correctioncoefficient D which can make the ground color of the image closer towhite within the range where the user easily reads characters, i.e.,there may still be a correction coefficient D which makes it easier fora user to read characters, but this correction coefficient D is notused.

However, in the second embodiment, because the image scanner selects thecorrection coefficients D in the order of a greater-to-smaller effect ofmaking the ground color closer to white, i.e., the image scanner selectsthe correction coefficients D in such a way that the ground color of theimage becomes darker gradually, it is possible to make the ground colorof the image as close as possible to white within the range where theuser easily reads characters.

An image scanner according to a third embodiment of the invention willbe described below with reference to FIGS. 10 and 11. The image scanneraccording to the third embodiment, like the one according to the secondembodiment, repeats the ground color correction, second characterrecognition, second character number counting, and superioritydetermining process. According to the third embodiment, however, aplurality of correction coefficients D are not set beforehand, and theimage scanner acquires the ground color density value from first imagedata to decide a correction coefficient D, and corrects the ground colorusing this correction coefficient D in the first ground colorcorrection. In second and subsequent ground color corrections, the imagescanner executes the ground color correction while changing thecorrection coefficient D used in the immediately previous ground colorcorrection according to a predetermined change rule.

The following description will be given of a case where thepredetermined changing rule is to decrease the correction coefficient Dused in the immediately previous ground color correction by ΔD by way ofexample. The correction coefficient D decreased by ΔD is an example of acorrection coefficient for making the ground color to a secondpredetermined ground color. The value of ΔD can be determined as suited.

The correction coefficient D is decreased by ΔD to reduce the effect ofmaking the ground color closer to white as compared to the effectprovided by the immediately previous ground color correction. If it isnot determined, with regard to the second image data whose ground colorhas been corrected in the immediately previous ground color correction,that the recognition result provided by the second character recognitionprocess is better, this means that the effect of making the ground colorcloser to white is too great, so that characters become difficult toread. To reduce the effect of making the ground color closer to white inthe next ground color correction, the image scanner decreases thecorrection coefficient D by ΔD.

It is to be noted that the correction coefficient D may be made smallerby multiplying the correction coefficient D used in the immediatelyprevious ground color correction by a value less than “1”, not bydecreasing the correction coefficient D by ΔD. ΔD need not be always thesame, but may be reduced, for example, as the number of ground colorcorrections increases, or may be increased as the number of ground colorcorrections increases.

FIG. 10 is a flowchart showing the flow of a scanning and outputtingprocess, according to the third embodiment. To avoid the redundantdescription, same reference numerals are given to the processing stepswhich are substantially the same as the corresponding processing stepsof the first embodiment. The scanning and outputting process accordingto the third embodiment differs from the scanning and outputting processaccording to the second embodiment in that the correction coefficient tobe used in the first ground color correction is determined based on theground color density value acquired from first image data according tothe third embodiment. Therefore, the controller 30 executes acquiring aground color density value from first image data and determining thecorrection coefficient D (S105 and S106 shown in FIG. 5).

In S601, the controller 30 sets “1” to the counter n that counts thenumber of corrections. In S602, the controller 30 executes the groundcolor correction, second character recognition, second character numbercounting, and superiority determining process, according to the thirdembodiment. In S603, the controller 30 determines whether image data tobe output is designated. When image data to be output is designated(S603: YES), the controller 30 proceeds to S110. When image data to beoutput is not designated (S603: NO), the controller 30 returns to S602and repeats the sequence of processes.

FIG. 11 is a flowchart showing the flow of the ground color correction,second character recognition, second character number counting, andsuperiority determining process, according to the third embodiment. Toavoid the redundant description, same reference numerals are given tothe processing steps which are substantially the same as thecorresponding processing steps of the first and second embodiments.

The ground color correction, second character recognition, secondcharacter number counting, superiority determining process according tothe third embodiment differs from the corresponding process according tothe second embodiment in that S502 according to the second embodiment isnot executed, and S701 is executed after S505 instead.

In S701, the controller 30 decreases the correction coefficient D by ΔD.

According to the above-described third embodiment, the image scannerdesignates the second image data as an output target as much as possibleby repeating the ground color correction, second character recognition,second character number counting, and superiority determining processwhile changing the correction coefficient, thereby increasing thepossibility of outputting image data after correction that makes iteasier for a user to read characters as compared with image data beforecorrection.

Further, this image scanner changes the correction coefficient D in sucha way as to reduce the effect of making the ground color closer to whiteas compared to the effect provided by the correction coefficient D usedin the previous ground color correction. If, for example, the correctioncoefficient D is changed in such a way as to increase the effect ofmaking the ground color closer to white as compared to the effectprovided by the correction coefficient D used in the previous groundcolor correction, the ground color of an image gradually comes closer towhite. In this case, when characters become easier to read for a userthan those before correction, there may still be a correctioncoefficient D which can make the ground color of the image closer towhite within the range where the user easily reads characters, i.e.,there may still be a correction coefficient D which makes it easier fora user to read characters, this correction coefficient D is not used.

However, in the third embodiment, because this image scanner changes thecorrection coefficient D in such a way as to reduce the effect of makingthe ground color closer to white as compared to the effect provided bythe correction coefficient D used in the previous ground colorcorrection, i.e., the image scanner changes the correction coefficient Din such a way that the ground color of the image becomes darkergradually, it is possible to make the ground color of the image as closeas possible to white within the range where the user easily readscharacters.

The embodiments are not limited to those described above referring tothe accompanying drawings, and following embodiments, for example, shallbe encompassed in the technical scope of the invention.

Although the foregoing descriptions of the embodiments have been givenof the case where the controller 30 of the image scanner 1 executes theground color correction, first character recognition, second characterrecognition, superiority determining, and outputting processes by way ofexample, those processes may be executed by a personal computer(hereinafter referred to as “PC”) that executes, for example, an imageprocessing program. A PC is an example of an image processing apparatus.

Specifically, for example, the image scanner 1 may transmit generatedimage data to a PC without executing ground color correction. The PC mayexecute the image processing program to execute the above individualprocesses, and may output image data which is determined to provide abetter recognition result. In this case, outputting image data includesstorage of image data in the memory, displaying an image on the display,printing an image by a printer, and transmission of image data toanother computer.

It is to be noted that image data is not limited to the one acquiredfrom the image scanner 1, but may be image data acquired from a WEB siteon the Internet or image data acquired from a digital camera.

The aforementioned image processing program is not limited to the onethat is executed by a PC, but may be executed by a cellular phone or aPDA (Personal Digital Assistant).

Although the foregoing descriptions of the embodiments have been givenof the case where an image represented by image data is a monochromaticimage, and ground color correction is executed on the density value ofthe R component by way of example, an image represented by image datamay be a color image.

It is to be noted however that the RCB density values of the individualpixels of a color image should not necessarily be the same. In thiscase, the color space of image data may be converted to YCbCr colorspace, so that ground color correction is executed using the densityvalue of the Y component. When the density value of the Y componentranges from 0 to 255, 0 represents black and 255 represents white. Inthis case, it is assumed that only the density value of the Y componentis corrected, and the density values of the Cb component and the Crcomponent are not corrected.

Although the foregoing descriptions of the embodiments have been givenof the case where the entire color of an image, not only the groundcolor but including the color of characters, is made closer to white byway of example, only the ground color may be made closer to white, andother colors than the ground color may not be made closer to white.Specifically, for example, ground color correction may be executed onlyon pixels which have such density values that the difference betweeneach of the density values and the ground color density value acquiredfrom first image data lies within a predetermined range.

Although the foregoing descriptions of the embodiments have been givenof the case where the controller 30 is an example of a controller, acontroller may comprise the controller 30 and the image processing unit37, or only the image processing unit 37 may function as a controller.

Although the foregoing descriptions of the embodiments have been givenof the case where white is an example of the predetermined color, thepredetermined color may be black when, for example, the ground color isgray and characters are in white.

While the invention has been described in connection with embodiments ofthe invention, it will be understood by those skilled in the art thatvariations and modifications of the embodiments described above may bemade without departing from the scope of the invention. Otherembodiments will be apparent to those skilled in the art from aconsideration of the specification or practice of the inventiondisclosed herein. It is intended that the specification and thedescribed examples are considered merely as exemplary of the invention,with the true scope of the invention being defined by the followingclaims.

What is claimed is:
 1. An image scanning apparatus comprising: ascanning unit configured to scan a document and generate original imagedata representing an original image; and a controller configured to:convert the original image data into converted image data representing afirst converted image, analyze the original image data and count anumber of first characters recognized in the original image representedby the original image data, analyze the converted image data and count anumber of second characters recognized in the converted imagerepresented by the first converted image data, compare the number offirst characters with the number of second characters and determinewhich one of the number of first characters and the number of secondcharacters is greater than the other, and output the original image datawhen the controller determines that the number of first characters isgreater than the number of second characters, and output the convertedimage data when the controller determines that the number of secondcharacters is greater than the number of first characters.
 2. The imagescanning apparatus according to claim 1, wherein the controller isconfigured to output the original image data when the controllerdetermines that the number of first characters is equal to the number ofsecond characters.
 3. The image scanning apparatus according to claim 1,wherein the controller is configured to convert the original image datainto the converted image data such that a ground color of the originalimage represented by the original image data is corrected to apredetermined ground color of the converted image represented by theconverted image data.
 4. The image scanning apparatus according to claim3, the controller is configured to: analyze the original image data andacquire a density value of a ground color of the original image, thedensity value indicating a ground color of the document, and determine acorrection coefficient such that when the controller converts theoriginal image data into the converted image data by using thecorrection coefficient, the acquired density value of the ground colorof the original image is converted into a density value of thepredetermined ground color of the converted image.
 5. The image scanningapparatus according to claim 1, wherein the controller is configured to:determine whether each of the number of first characters and the numberof second characters is greater than a reference number, and output theoriginal image data, regardless of which one of the number of firstcharacters and the number of second characters is greater than theother, when the controller determines that both the number of firstcharacters and the number of second characters are less than or equal tothe reference number.
 6. The image scanning apparatus according to claim1, further comprising a notifying unit, wherein when the controlleroutputs the original image data, the controller is configured to controlthe notifying unit to notify a user that the original image data remainsintact.
 7. An image scanning apparatus comprising: a scanning unitconfigured to scan a document and generate original image datarepresenting an original image; and a controller configured to: convertthe original image data into first to Nth converted image data in thisorder, wherein N is an integer greater than 2, analyze the originalimage data and count a number of first characters recognized in theoriginal image represented by the original image data, each time thecontroller converts the original image data into one of the first to Nthconverted image data, analyze the one of the first to Nth convertedimage data and count a number of second characters recognized in acorresponding converted image, compare the number of first characterswith the number of second characters and determine which one of thenumber of first characters and the number of second characters isgreater than the other, output the one of the first to Nth convertedimage data when the controller determines that the number of secondcharacters is greater than the number of first characters, and stopconverting the original image data once the controller outputs the oneof the first to Nth converted image data.
 8. The image scanningapparatus according to claim 7, wherein the controller is configured tooutput the original image data when the controller converts the originalimage data to the Nth converted image data and determines that thenumber of first characters is greater than a number of second charactersrecognized in a corresponding converted image represented by the Nthconverted image data.
 9. The image scanning apparatus according to claim7, wherein the controller is configured to convert the original imagedata into the first to Nth converted image data by using first to Nthcorrection coefficients, respectively in this order, such that a groundcolor of the original image is corrected to predetermined ground colorsof converted images, respectively.
 10. The image scanning apparatusaccording to claim 9, wherein the controller is configure to storetherein the first to Nth correction coefficients.
 11. The image scanningapparatus according to claim 9, wherein the controller is configured toobtain each of second to Nth correction coefficients by changing acorresponding immediately previous correction coefficient according to apredetermined rule.
 12. The image scanning apparatus according to claim9, wherein the first to Nth correction coefficients have an effect ofcorrecting the ground color of the original image to a color closer towhite, the effect decreasing in an order from the first to Nthcorrection coefficients.
 13. An image processing apparatus comprising: acontroller configured to: obtain original image data representing anoriginal image, convert the original image data into converted imagedata representing a converted image, analyze the original image data andcount a number of first characters recognized in the original imagerepresented by the original image data, analyze the converted image dataand count a number of second to characters recognized in the convertedimage represented by the first converted image data, compare the numberof first characters with the number of second characters and determinewhich one of the number of first characters and the number of secondcharacters is greater than the other, and output the original image datawhen the controller determines that the number of first characters isgreater than the number of second characters, and output the convertedimage data when the controller determines that the number of secondcharacters is greater than the number of first characters.
 14. The imageprocessing apparatus according to claim 13, the controller is configuredto convert the original image data into the converted image data suchthat a ground color of the original image represented by the originalimage data is corrected to a predetermined ground color of the convertedimage represented by the converted image data.
 15. A non-transitorycomputer-readable recording medium, for use in an image processingapparatus, storing computer readable instructions, the computer readableinstructions, when executed by a processor, causing the image processingapparatus to perform: obtaining original image data representing anoriginal image, converting the original image data into converted imagedata representing a converted image, analyzing the original image dataand counting a number of first characters recognized in the originalimage represented by the original mage data, analyzing the convertedimage data and counting a number of second characters recognized in theconverted image represented by the first converted mage data, comparingthe number of first characters with the number of second characters anddetermining which one of the number of first characters and the numberof second characters is greater than the other, and outputting theoriginal image data when the controller determines that the number offirst characters is greater than the number of second characters, andoutputting the converted image data when the controller determines thatthe number of second characters is greater than the number of firstcharacters.
 16. The non-transitory computer-readable recording mediumaccording to claim 15, wherein the original image data is converted intothe converted image data such that a ground color of the original imagerepresented by the original image data is corrected to a predeterminedground color of the converted image represented by the converted imagedata.